import request from '../index';

const cpoUrl = '/cpo-server';
const flowUrl = '/flow-server';

// 分页查询互联互通密钥
export const URL_PAGINGCECCONFIG = `${cpoUrl}/cpoConfig/pagingCecConfig`;
export const pagingCecConfig = (params: any, pages: any) => {
  return request({
    url: `${cpoUrl}/cpoConfig/pagingCecConfig`,
    params: { form: params, pages: pages },
  });
};
// 新增/保存互联互通密钥
export const saveCecConfig = (params: any) => {
  return request({
    url: `${cpoUrl}/cpoConfig/saveCecConfig`,
    params: { form: params, successMsg: '1' },
  });
};
// 修改互联互通密钥
export const updateCecConfig = (params: any) => {
  return request({
    url: `${cpoUrl}/cpoConfig/updateCecConfig`,
    params: { form: params, successMsg: '1' },
  });
};
// 查询互联互通密钥
export const queryCecConfig = (params: any) => {
  return request({
    url: `${cpoUrl}/cpoConfig/queryCecConfig`,
    params: { form: params },
  });
};

// 分页查询入口方案
export const URL_PAGINGENTRANCEPLAN = `${cpoUrl}/entrancePlan/pagingEntrancePlan`;
export const pagingEntrancePlan = (params: any, pages: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/pagingEntrancePlan`,
    params: { form: params, pages: pages },
  });
};
// 新增/保存入口方案
export const saveEntrancePlan = (params: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/saveEntrancePlan`,
    params: { form: params, successMsg: '1' },
  });
};
// 修改入口方案
export const updateEntrancePlan = (params: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/updateEntrancePlan`,
    params: { form: params, successMsg: '1' },
  });
};
// 查询入口方案
export const queryEntrancePlan = (params: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/queryEntrancePlan`,
    params: { form: params },
  });
};

// 手动启用入口方案
export const startEntrancePlan = (params: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/startEntrancePlan`,
    params: { form: params, successMsg: '2' },
  });
};

// 手动停用入口方案
export const stopEntrancePlan = (params: any) => {
  return request({
    url: `${cpoUrl}/entrancePlan/stopEntrancePlan`,
    params: { form: params, successMsg: '2' },
  });
};

// 分页查询流量方案
export const URL_PAGINGPLAN = `${flowUrl}/plan/pagingPlan`;
export const pagingPlan = (params: any, pages: any) => {
  return request({
    url: `${flowUrl}/plan/pagingPlan`,
    params: { form: params, pages: pages },
  });
};
// 新增/保存流量方案
export const savePlan = (params: any) => {
  return request({
    url: `${flowUrl}/plan/savePlan`,
    params: { form: params, successMsg: '1' },
  });
};
// 修改流量方案
export const updatePlan = (params: any) => {
  return request({
    url: `${flowUrl}/plan/updatePlan`,
    params: { form: params, successMsg: '1' },
  });
};
// 查询流量方案
export const getPlan = (params: any) => {
  return request({
    url: `${flowUrl}/plan/getPlan`,
    params: { form: params },
  });
};
// 手动启用流量方案
export const startPlan = (params: any) => {
  return request({
    url: `${flowUrl}/plan/startPlan`,
    params: { form: params, successMsg: '2' },
  });
};

// 手动停用流量方案
export const stopPlan = (params: any) => {
  return request({
    url: `${flowUrl}/plan/stopPlan`,
    params: { form: params, successMsg: '2' },
  });
};